#!/bin/sh
partern=".sh"
mypath="/root/shell/mypath/"
topath="/root/shell/topath/"
list=$(ls "$mypath"|grep "$partern")

for file in $list
do
#echo "$file"
fromfile="$mypath$file"
tofile="$topath$file"
echo "from $fromfile to $tofile"
#echo to $tofile
tr -d \\r <$fromfile >$tofile
done

exit 0